<extend name="common:commonTemplate" />
<block name="main_content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="index.html"
				data-original-title="Go to Home"><i class="icon-home"></i> 首页</a> <a
				href="#">商品</a> <a class="current" href="#">商品添加</a>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-info-sign"></i>
						</span>
						<h5>商品更新</h5>
					</div>
					<div class="widget-content nopadding">
						<form novalidate="novalidate" id="basic_validate"
							name="basic_validate" action="#" method="post"
							class="form-horizontal">
							<div class="control-group">
								<label class="control-label">商品编号:</label>
								<div class="controls">
									<input type="text" id="style_id" value="{$style_en.style_id}"
										name="required" readonly="readonly" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">商品编码:</label>
								<div class="controls">
									<input type="text" id="style_sn" name="required" value="{$style_en.style_sn}"/>
								</div>
							</div>
								<div class="control-group">
								<label class="control-label">商品名称:</label>
								<div class="controls">
									<input type="text" id="style_name" name="required" value="{$style_en.style_name}"/>
								</div>
							</div>
								
								<div class="control-group">
								<label class="control-label">商品简介:</label>
								<div class="controls">
									<input type="text" id="style_brief" name="required" value="{$style_en.style_brief}"/>
								</div>
							    </div>
							<div class="control-group">
								<label class="control-label">sku渠道</label>
								<div class="controls">
								<select id="sku_channel" style="width:220px;" >
									 <if condition="$style_en.sku_channel eq '1'">
								
										<option value="1" selected="selected">淘宝</option>
										
								   <else/>
								 
										<option value="1">淘宝</option>
										
								</if>
								
								
								
								 <if condition="$style_en.sku_channel eq '2'">
								
										
										<option value="2" selected="selected">京东</option>
										
								   <else/>
								   
										<option value="2">京东</option>
										
								</if>
								
								
								
								 <if condition="$style_en.sku_channel eq '3'">
								
										<option value="3" selected="selected">官网</option>
										
								   <else/>
								   
										<option value="3">官网</option>
										
								</if>
								
								
								 <if condition="$style_en.sku_channel eq '5'">
								
										<option value="5" selected="selected">英雄会O2O</option>
										
								   <else/>
								  
										<option value="5">英雄会O2O</option>
										
								</if>
								
								
								 <if condition="$style_en.sku_channel eq '6'">
								
										<option value="6" selected="selected">村淘</option>
										
								   <else/>
								   
										<option value="6">村淘</option>
										
								</if>
								
								 <if condition="$style_en.sku_channel eq '8'">
								
										<option value="8" selected="selected">大客户</option>
										
								   <else/>
								  
										<option value="8">大客户</option>
									
								</if>
								
								<if condition="$sku_en.sku_channel eq '10'">
								
										<option value="10" selected="selected">VR渠道</option>
										
								   <else/>
								  
										  <option value="10">VR渠道</option>
									
								</if>
								
								<if condition="$sku_en.sku_channel eq '11'">
								
										<option value="11" selected="selected">四川电信</option>
										
								   <else/>
								  
									<option value="11">四川电信</option>
									
								</if>
								</select>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">商品渠道名称:</label>
								<div class="controls">
									<input type="text" id="sku_channel_name" name="required" value="{$style_en.sku_channel_name}"/>
								</div>
							    </div>
							   <div class="control-group">
								<label class="control-label">上架时间:</label>
								<div class="controls">
									<input id="sale_date" value="{$style_en.sale_date}" style="background-color: #fff;border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;width:217px;color:#555;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
								</div>
							</div> 
							    
							<div class="control-group">
								<label class="control-label">市场价:</label>
								<div class="controls">
									<input type="text" id="market_price" name="required" value="{$style_en.market_price}"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">市场价:</label>
								<div class="controls">
									<input type="text" id="shop_price" name="required" value="{$style_en.shop_price}"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">最低销售单价:</label>
								<div class="controls">
									<input type="text" id="sale_min_price" name="required" value="{$style_en.sale_min_price}"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">最高销售单价:</label>
								<div class="controls">
									<input type="text" id="sale_max_price" name="required" value="{$style_en.sale_max_price}"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">sku总库存:</label>
								<div class="controls">
									<input type="text" id="sku_stock" name="required" value="{$style_en.sku_stock}"/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">是否实体商品:</label>
								<div class="controls">
									<select id="is_real" style="width:220px;">
									<if condition="$style_en.is_real eq '0'">
									<option value="0" selected="selected">非</option>
									<else/>
									<option value="0">非</option>
									</if>
									<if condition="$style_en.is_real eq '1'">
									<option value="1" selected="selected">是</option>
									<else/>
									<option value="1">是</option>
									</if>
					                 
					                </select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">状态:</label>
								<div class="controls">
									<select id="status" style="width:220px;">
									<if condition="$style_en.status eq '0'">
									<option value="0" selected="selected">无效</option>
									<else/>
									<option value="0">无效</option>
									</if>
									<if condition="$style_en.status eq '1'">
									<option value="1" selected="selected">有效</option>
									<else/>
									<option value="1">有效</option>
									</if>
					                 
					                </select>
								</div>
							</div>
							<div class="control-group">
								<a id="btn_addStyle" class="btn btn-success">添加商品</a> 
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</block>


<block name="js_content">
<script src="/Public/js/laydate/laydate.js"></script> 
 <script>
		//新增页面资源管理
		$('#btn_addStyle').bind('click', function(){
			var style_id = $('#style_id').val();
			var style_sn = $('#style_sn').val();
			var style_name = $('#style_name').val();
			var style_brief = $('#style_brief').val();
			var sku_channel = $('#sku_channel').val();
			var sku_channel_name = $('#sku_channel_name').val();
			var sale_date = $('#sale_date').val();
			var market_price = $('#market_price').val();
			var shop_price = $('#shop_price').val();
			var sale_min_price = $('#sale_min_price').val();
			var sale_max_price = $('#sale_max_price').val();
			var sku_stock = $('#sku_stock').val();
			var is_real = $('#is_real').val();
			var status = $('#status').val();
			
			var result = StyleService.UpdateStyle(style_id, style_sn,  style_name, style_brief ,
					sku_channel, sku_channel_name, sale_date, market_price , shop_price,
					sale_min_price , sale_max_price , sku_stock , is_real ,
					status);
		
			if (result.IsSuccess == 0) {

				return;
			} else {
				alert('操作成功');
				$('#promoter_status').text('有效');
			}
		});
</script> </block>